Learn R Programming

trackdf (version 0.3.3)

[.track: Extract or Replace Parts of a Track Table

Description

Accessing columns, rows, or cells via $, [[, or [ is mostly similar to regular data frames. However, the behavior is sometimes different for track tables based on tibble and data.table. For more info, refer to tibble's and data.table's subsetting documentation.

Usage

# S3 method for track
[(x, ...)

# S3 method for track [(x, ...) <- value

Value

A subset of the track table is [ is called, or a modified version of the track table if [<- is called.

Arguments

x

A track table.

...

Other parameters to be passed to the extracting/subsetting functions of data.frame, tibble, and data.table.

value

A suitable replacement value: it will be repeated a whole number of times if necessary and it may be coerced: see the `Coercion` section in data.frame. If `NULL`, deletes the column if a single column is selected.

Author

Simon Garnier, garnier@njit.edu

See Also

track_df, track_tbl, track_dt

Examples

Run this code
data(short_tracks)

short_tracks[1]
short_tracks[1, ]
short_tracks[1, 1]
short_tracks$id[short_tracks$id == "1"] <- "0"
short_tracks[short_tracks[, 1] == "0", 1] <- "1"

Run the code above in your browser using DataLab